package com.vn.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="ChargeRegister")
public class ChargeRegister {
	
	public ChargeRegister(){}
	
	public ChargeRegister(double cost, String description) {
		super();
		this.cost = cost;
		this.description = description;
	}

	@Id
	@GeneratedValue
	@Column(name="IDCharge")
	private int id;
	
	@Column(name="TimeAdd")
	private Date timeAdd=new Date();
	
	@Column(name="Cost")
	private double cost;
	
	@Column(name="Description")
	private String description;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getTimeAdd() {
		return timeAdd;
	}

	public void setTimeAdd(Date timeAdd) {
		this.timeAdd = timeAdd;
	}

	public double getCost() {
		return cost;
	}

	public void setCost(double cost) {
		this.cost = cost;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	@OneToMany
	private List<ChargeRegisterPayment> chargeRegisterPayments;

	public List<ChargeRegisterPayment> getChargeRegisterPayments() {
		return chargeRegisterPayments;
	}

	public void setChargeRegisterPayments(
			List<ChargeRegisterPayment> chargeRegisterPayments) {
		this.chargeRegisterPayments = chargeRegisterPayments;
	}
	
	
}
